{% extends "base.html" %}

{% block content %}
<div class="container my-4 p-4 bg-light rounded shadow-sm">
    <h2 class="text-center mb-4 text-primary">添加新郑码记录</h2>
    <form method="post" class="row g-3">
        <!-- Hanzi Field -->
        <div class="col-12">
            <label for="hanzi" class="form-label fw-bold text-secondary">汉字:</label>
            <input type="text" id="hanzi" name="hanzi" class="form-control" placeholder="输入汉字" required>
        </div>

        <!-- Quanma Field -->
        <div class="col-12">
            <label for="quanma" class="form-label fw-bold text-secondary">全码:</label>
            <input type="text" id="quanma" name="quanma" class="form-control" placeholder="输入全码" required>
        </div>

        <!-- Quanma Field -->
        <div class="col-12">
            <label for="pinyin" class="form-label fw-bold text-secondary">拼音:</label>
            <input type="text" id="pinyin" name="pinyin" class="form-control" placeholder="输入拼音" required>
        </div>

        <!-- Quanma Field -->
        <div class="col-12">
            <label for="jieshi" class="form-label fw-bold text-secondary">解释:</label>
            <input type="text" id="jieshi" name="jieshi" class="form-control" placeholder="输入解释" required>
        </div>

        <!-- Yima Field -->
        <div class="col-md-6">
            <label for="yima" class="form-label fw-bold text-secondary">第一码:</label>
            <input type="text" id="yima" name="yima" class="form-control" placeholder="输入第一码">
        </div>

        <!-- Erma Field -->
        <div class="col-md-6">
            <label for="erma" class="form-label fw-bold text-secondary">第二码:</label>
            <input type="text" id="erma" name="erma" class="form-control" placeholder="输入第二码">
        </div>

        <!-- Sanma Field -->
        <div class="col-md-6">
            <label for="sanma" class="form-label fw-bold text-secondary">倒数第二码:</label>
            <input type="text" id="sanma" name="sanma" class="form-control" placeholder="输入倒数第二码">
        </div>

        <!-- Sima Field -->
        <div class="col-md-6">
            <label for="sima" class="form-label fw-bold text-secondary">末码:</label>
            <input type="text" id="sima" name="sima" class="form-control" placeholder="输入末码">
        </div>

        <!-- Danzi Field -->
        <div class="col-12">
            <div class="form-check">
                <input class="form-check-input" type="checkbox" id="danzi" name="danzi" value="1">
                <label class="form-check-label fw-bold text-secondary" for="danzi">是否单字</label>
            </div>
        </div>

        <!-- Buttons -->
        <div class="col-12 text-center">
            <button type="submit" class="btn btn-primary px-4">添加</button>
            <a href="{{ url_for('index') }}" class="btn btn-outline-secondary px-4 ms-2">取消</a>
        </div>
    </form>
</div>
{% endblock %}